package com.ruoyi.web.controller.warning;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.warning.domain.query.IndexTwoQuery;
import com.ruoyi.warning.domain.vo.EventIndexVO;
import com.ruoyi.warning.mapper.IndexTwoMapper;
import com.ruoyi.warning.service.IDisposeService;
import com.ruoyi.warning.service.IndexTwoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 告警模版表 前端控制器
 * </p>
 *
 * @author chenhc
 * @since 2025-02-20
 */
@RestController
@RequestMapping("/eventIndex")
@Api(tags = "事件看板", description = "用于处理事件看板相关操作的控制器")
public class IndexTwoController {
    @Resource
    private IndexTwoService indexTwoService;
    @Resource
    private IDisposeService disposeService;
    @Resource
    private IndexTwoMapper indexTwoMapper;

    @ApiOperation("事件状态统计")
    @Anonymous
    @GetMapping(value = "/getEventDisposeSituation")
    public R getEventDisposeSituation(IndexTwoQuery indexTwoQuery)
    {
        List<Map<String,Integer>> list = indexTwoMapper.getEventDisposeSituation(indexTwoQuery);
        return R.ok(list);
    }

    @ApiOperation("设备类型事件统计")
    @Anonymous
    @GetMapping(value = "/getDeviceTypeSituation")
    public R getDeviceTypeSituation(IndexTwoQuery indexTwoQuery)
    {
        List<Map<String,Integer>> list = indexTwoMapper.getDeviceTypeSituation(indexTwoQuery);
        return R.ok(list);
    }

    @ApiOperation("详细事件展示")
    @Anonymous
    @GetMapping(value = "/getEventShow")
    public R getEventShow(IndexTwoQuery indexTwoQuery)
    {
        List<EventIndexVO> list = indexTwoMapper.getEventShow(indexTwoQuery);
        return R.ok(list);
    }


}
